package cn.lg.soar.boot.client.entity;

import cn.lg.soar.core.annotations.constraints.group.Create;
import cn.lg.soar.core.annotations.constraints.group.Update;
import cn.lg.soar.database.base.entity.BaseEntity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 用户信息表
 * @author ZhuanZ（无密码）
 * @since 2025-02-13
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
@ApiModel(value = "User", description = "用户信息表")
@TableName("fc_user")
public class ClientUser extends BaseEntity {

    /** 唯一编码 */
    @NotNull(message = "主键不能为空", groups = { Update.class })
    @ExcelIgnore
    @ApiModelProperty(value = "主键")
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 用户名称 */
    @NotBlank(message = "用户名称不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "用户名称")
    @ApiModelProperty(value = "用户名称")
    private String userName;

    /** 真实姓名 */
    @ExcelProperty(value = "真实姓名")
    @ApiModelProperty(value = "真实姓名")
    private String realName;

    /** 登录帐号/工号 */
    @NotBlank(message = "登录帐号/工号不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "登录帐号/工号")
    @ApiModelProperty(value = "登录帐号/工号")
    private String account;

    /** 登录密码 */
//    @NotBlank(message = "登录密码不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "登录密码")
    @ApiModelProperty(value = "登录密码")
    private String password;

    /** 部门ID */
    @ExcelProperty(value = "部门ID")
    @ApiModelProperty(value = "部门ID")
    private Long orgId;

    /** 头像 */
    @ExcelProperty(value = "头像")
    @ApiModelProperty(value = "头像")
    private String avatar;

    /** 密码盐 */
//    @NotBlank(message = "密码盐不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "密码盐")
    @ApiModelProperty(value = "密码盐")
    private String salt;

    /** 职工类型(0-普通教职工 1-博士后 2-特聘 3-校外人员 4-学生) */
    @NotNull(message = "职工类型(0-普通教职工 1-博士后 2-特聘 3-校外人员 4-学生)不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "职工类型(0-普通教职工 1-博士后 2-特聘 3-校外人员 4-学生)")
    @ApiModelProperty(value = "职工类型(0-普通教职工 1-博士后 2-特聘 3-校外人员 4-学生)")
    private Integer workersType;

    /** 电子邮箱 */
    @ExcelProperty(value = "电子邮箱")
    @ApiModelProperty(value = "电子邮箱")
    private String email;

    /** 手机号码 */
    @ExcelProperty(value = "手机号码")
    @ApiModelProperty(value = "手机号码")
    private String mobile;

    /** 年龄 */
    @ExcelProperty(value = "年龄")
    @ApiModelProperty(value = "年龄")
    private Integer age;

    /** 性别(0-男 1-女) */
    @ExcelProperty(value = "性别(0-男 1-女)")
    @ApiModelProperty(value = "性别(0-男 1-女)")
    private Integer sex;

    /** 生日 */
    @ExcelProperty(value = "生日")
    @ApiModelProperty(value = "生日")
    private String birthday;

    /** 用户令牌 */
    @ExcelProperty(value = "用户令牌")
    @ApiModelProperty(value = "用户令牌")
    private String token;

    /** 证件类型(0-身份证 1-护照 2-港澳台通行证) */
    @NotNull(message = "证件类型(0-身份证 1-护照 2-港澳台通行证)不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "证件类型(0-身份证 1-护照 2-港澳台通行证)")
    @ApiModelProperty(value = "证件类型(0-身份证 1-护照 2-港澳台通行证)")
    private Integer certificateType;

    /** 身份证 */
    @ExcelProperty(value = "身份证")
    @ApiModelProperty(value = "身份证")
    private String idcard;

    /** 表单结果ID */
    @ApiModelProperty(value = "表单结果ID")
    private Long formResultId;

    /** 审核状态(0-待提交 1-待审核 2-通过 9-拒绝) */
//    @NotNull(message = "审核状态(0-待提交 1-待审核 2-通过 9-拒绝)不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "审核状态(0-待提交 1-待审核 2-通过 9-拒绝)")
    @ApiModelProperty(value = "审核状态(0-待提交 1-待审核 2-通过 9-拒绝)")
    private Integer result;

    /** 最后登陆IP */
    @ExcelProperty(value = "最后登陆IP")
    @ApiModelProperty(value = "最后登陆IP")
    private String lastLoginIp;

    /** 最后登陆时间 */
    @ExcelProperty(value = "最后登陆时间")
    @ApiModelProperty(value = "最后登陆时间")
    private LocalDateTime lastLoginTime;

    /** 冻结时间 */
    @ExcelProperty(value = "冻结时间")
    @ApiModelProperty(value = "冻结时间")
    private LocalDateTime freezeDate;

    /** 冻结原因 */
    @ExcelProperty(value = "冻结原因")
    @ApiModelProperty(value = "冻结原因")
    private String freezeCause;

    /** 数据状态 */
    @ExcelProperty(value = "数据状态")
    @ApiModelProperty(value = "数据状态")
    private Integer status;

    /** 备注信息 */
    @ExcelProperty(value = "备注信息")
    @ApiModelProperty(value = "备注信息")
    private String remark;

    /** 附件 */
    @ExcelProperty(value = "附件")
    @ApiModelProperty(value = "附件")
    private String attachment;

    /** 扩展字段1 */
    @ExcelProperty(value = "扩展字段1")
    @ApiModelProperty(value = "扩展字段1")
    private String extend1;

    /** 扩展字段2 */
    @ExcelProperty(value = "扩展字段2")
    @ApiModelProperty(value = "扩展字段2")
    private String extend2;

    /** 扩展字段3 */
    @ExcelProperty(value = "扩展字段3")
    @ApiModelProperty(value = "扩展字段3")
    private String extend3;

    @JsonIgnore
    @Override
    public Long primaryKey() {
        return this.id;
    }

}
